package com.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.servlet.http.HttpSession;

public class DataBase {
	private static String url = "jdbc:sqlserver://localhost:1433;databaseName=StudentManager";
	private static String driverClass = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
	private static String dbName = "sa";
	private static String dbPwd = "zhrmghg";

	public static Connection getConnection()
	{
		Connection con = null;
		try {

			Class.forName(driverClass);
			con = DriverManager.getConnection(url, dbName, dbPwd);
			

		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return con;
	}
}
